﻿@model SKB.ViewModels.ProjectListViewModel

<script type="text/javascript">
    $(function () {

        $("#addProject").click(function () {
            $("#addProjectModal").slideToggle();

        });

    });
</script>


@{
    ViewBag.Title = "Index";
}

<h2>Santader Software Projects</h2>

<hr />

<p>
    <a id="addProject" href="#">Create New</a>
</p>

<div id="addProjectModal" style="display:none;">

    <fieldset>
        <legend>Create Project</legend>

        <div class="line-group">

             <div class="editor-group">
                <div class="editor-label">
                    @Html.LabelFor(model => model.NewRecord.ProjectName)
                </div>
                <div class="editor-field">
                    @Html.EditorFor(model => model.NewRecord.ProjectName)
                </div>
            </div>

             <div class="editor-group">
                <div class="editor-label">
                    @Html.LabelFor(model => model.NewRecord.ProjectDescription)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.NewRecord.ProjectDescription)
                </div>
            </div>
            
            <div class="editor-group">
                <button onclick="SendCreateRequest()" id="btnAddDetailLine" name="btnAddDetailLine">ADD</button>  
            </div>
                                     
        </div>
      

    </fieldset>
    
</div>




@if (Model.List.Count() == 0)
{

    <div style="vertical-align:middle;">
        <img style="vertical-align:middle;" alt="" src="@Url.Content("~/Images/dialog_warning.png")"  />
        <span style="font-size:14px; background-color:Orange; padding: 7px;" class="small-bold-text">No Projects on file!</span>
    </div>

}
else
{

    <table>
        <tr>

            <th>
                @Html.DisplayNameFor(model => model.NewRecord.ProjectName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.NewRecord.ProjectDescription)
            </th>

        </tr>

    @foreach (var item in Model.List)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ProjectName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProjectDescription)
            </td>
        </tr>
    }

    </table>
}